package com.aboo.es.vo;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.io.Serializable;
import java.util.Date;

@Data
@Document(indexName = "movie", type = "_doc")
public class Movie implements Serializable {

    @Id
    private String id;

    /**
     * 是否索引：就是看该域是否能被搜索
     * 是否分词：就表示搜索的时候是整体匹配还是单词匹配
     * 是否存储：就是是否在页面上显示
     */
    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String name;

    @Field(type = FieldType.Text, analyzer = "ik_max_word", searchAnalyzer = "ik_max_word")
    private String desc;

    @Field(type = FieldType.Date)
    private Date createdDate;

}
